package bpmjs;

typedef Vector3TP = {tx : Float, ty : Float, tz : Float, px : Float, py : Float, pz : Float};

class Camera
{
	public var tx : Float;
	public var ty : Float;
	public var distance : Float;
	public var zoom : Float;

	public static inline function inlineProject(c : Camera, v : Vector3TP) : Void
	{
		v.pz = (v.tz + c.distance) * c.zoom;
		v.px = v.tx * v.pz + c.tx;
		v.py = v.ty * v.pz + c.ty;
	}
		
	public function new()
	{
	}
	
	public inline function project(v : Vector3TP) : Void
	{
		v.pz = (v.tz + distance) * zoom;
		v.px = v.tx * v.pz + tx;
		v.py = v.ty * v.pz + ty;
	}
}
